﻿<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/2000/xmlns">
<head>
	<title>JameE - Example</title>


	<!-- STEP 0: Include Canvas emulator (IE8 and earlier only). -->
		<!--[if lte IE 8]>
		<script src="../Libraries/excanvas.compiled.js" type="text/javascript"></script>
		<![endif]-->


	<!-- STEP 1: specify the base path to the JameE scripts. -->
	<script type="text/javascript">	var JameE_base_path = "../";</script>


	<!-- STEP 2: include the JameE boostrapper. -->
	<script type="text/javascript" src="../JameE.js"></script>


</head>
<body>

	<!-- STEP 3: define a Canvas object for our frame buffer. -->
	<canvas id="host" width="640" height="480" style="border-style:solid; border-color:black; border-width:1px;"></canvas>
	
	<br />
	<span id="loadingmessage" style="font-style:italic;"> Loading... </span>


	<!-- STEP 4: specify "on ready" code to be run once JameE is loaded. -->
	<script type="text/javascript">//<![CDATA[
		
		
		$JameE(function () {


			// hide loading message
			var oNodeLoadingMessage = document.getElementById("loadingmessage");
			oNodeLoadingMessage.parentNode.removeChild(oNodeLoadingMessage);

			// init engine object
			var oEngine = new JameE.Engine.Engine();
			oEngine.setCanvas(document.getElementById("host"));
			oEngine.run();




			////
			// EXAMPLE 1: load a game file containing a simple scene.
			
			$load(
				"Examples/Example-Game.obj.txt",
				function (oData) {
					oEngine.setScene(oData);

				}
			);

			//
			//////




			//////
			// EXAMPLE 2: create a scene with a mathematical graph (perhaps for AI paths).

//			var oScene = new JameE.Engine.Scene({ drawCoordinateSystem: true });
//			oEngine.setScene(oScene);
//			var oGraph = new JameE.Math.Graph();
//			var oGraphVisualizer = new JameE.Assets.GraphVisualizer({ graph: oGraph });
//			oScene.add(oGraphVisualizer);

//			// add some points to the graph
//			oGraph.addVerticesAndEdge($vector3(-35, 50), $vector3(10, 10));
//			oGraph.addVerticesAndEdge($vector3(10, 10), $vector3(70, 40));
//			oGraph.addVerticesAndEdge($vector3(70, 40), $vector3(-30, -40));

			//
			//////

		});

	//]]></script>
</body>
</html>
